<?php

#<editor-fold defaultstate="collapsed" desc="CCore::Using">
CCore::Using('base.utils');
#</editor-fold>

abstract class ACoreLogger
{
	#<editor-fold defaultstate="collapsed" desc="abstract functions">
	/**
	 * @param	string	$sDesc
	 * @return	bool
	 */
	abstract protected function writeImplementation($sDesc);

	/**
	 * @param	string	$sTimePrefix
	 * @param	string	$sDesc
	 * @return	string
	 */
	abstract protected function logLineImplementation($sTimePrefix, $sDesc);
	
	/**
	 * @return	bool
	 */
	abstract protected function clearImplementation();
	#</editor-fold>
	
	/**
	 * @param	string	$sDesc
	 * @return	bool
	 */
	final public function Write($sDesc)
	{
		CCore::CheckTypes(array('$sDesc'));
		
		return $this->writeImplementation($this->logLineImplementation(
			CCoreBaseUtils::GetTimeWithMicroSec(), $sDesc));
	}

	/**
	 * @return	bool
	 */
	final public function Clear()
	{
		return $this->clearImplementation();
	}
}
